<template>
	<view class="">
		<s-pull-scroll ref="pullScroll" :pullDown="pullDown" :pullUp="loadData" :back-top="true">
			<view class="">
				<view class="" v-for="(item,index) in dataList" :key="index" @tap="itemOnClick(v)">
					<view class="item-r-time" style="text-align: center;">{{item.createDate}}</view>
					<view class="item">
						<view class="item-top b-b column center">
							<view class="">
								<text class="user-options">本次提现</text>
								<text class="user-options on" v-if="item.status==1">（待审核）</text>
								<text class="user-options out" v-if="item.status==2">（已审核）</text>
								<text class="user-options jest" v-if="item.status==3">（被拒绝）</text>
							</view>
							<view class="user-money">{{item.money}}</view>
						</view>
						<view class="row between">
							<text class="item-r-time" style="color: #896C4D;">申请提现时间</text>
							<text class="item-r-time">{{item.createDate}}</text>
						</view>
					</view>
				</view>
			</view>
		</s-pull-scroll>
	</view>
</template>

<script>
export default {
	data() {
		return {
			dataList: [],
			type:""
		};
	},
	onLoad(options) {
		this.type=options.type;
		this.refresh();
	},
	methods: {
		pullDown(pullScroll) {
			setTimeout(() => {
				this.loadData(pullScroll);
			}, 200);
		},
		async loadData(pullScroll) {
			// 0余额1佣金
			const data = {
				uid: uni.getStorageSync("uid"),
				pageNo: pullScroll.page,
				type:this.type,
				pageSize: "10"
			};
			const res = await this.$request("user/withdraw-list", data, {showLoading: true});
			if (pullScroll.page == 1) {
				this.dataList = [];
			}
			if (res.result == 1 || res.data.list.length == 0) {
				pullScroll.empty();
				return;
			} else {
				this.dataList = this.dataList.concat(res.data.list);
				pullScroll.page >= Math.ceil(res.data.count / 10) ? pullScroll.finish() : pullScroll.success();
			}
		}
	}
};
</script>
<style scoped>
.on {
	color: #0076fe !important;
}
.out {
	color: #18c254 !important;
}
.jest{
	color: #99130C !important;
}
.item {
	width: 94%;
	padding: 0 20upx;
	background: #ffffff;
	// box-shadow: 10upx 10upx 10upx 10upx rgba(225, 225, 225, 0.43);
	box-shadow: 0px 0px 46upx 0px rgba(204, 204, 204, 0.43);
	border-radius: 20upx;
	margin: 0 auto 20upx;
	position: relative;
}
.item-top {
	padding: 46upx 0;
}
.user-options {
	font-size: 24upx;
	font-family: PingFang SC;
	font-weight: 500;
	color: #666666;
	line-height: 36upx;
}
.user-money {
	font-size: 49upx;
	font-family: Adobe Heiti Std;
	font-weight: bold;
	color: #000000;
	line-height: 40upx;
	padding-top: 30upx;
}
.item-r-time {
	font-size: 24upx;
	font-family: PingFang SC;
	font-weight: 500;
	color: #8f8f8f;
	line-height: 80upx;
}
</style>
